<?php $this->load->view('common/head');?>

<?php $this->load->view('common/header');?>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <?php $this->load->view('common/sidebar');?>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <?php $this->load->view('common/breadcrumbs');?>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">

                <?php $this->load->view('common/set');?>

                <!-- /section:settings.box -->
                <div class="row">
                    <form id="form2" class="form-inline" action="<?php echo site_url(X_URL.'finance/recharge_search')?>" method="get">
                    <!-- <?php echo csrf_hidden();?> -->
                        <label class="inline">用户名：</label>
                        <select name="user_id" class="form-control select2" id="user_id" size="1">
                            <option value="0">请选择查询用户</option>
                        <?php if($users){ foreach ($users as $key => $val) {?>
                            <option value="<?php echo $val['user_id'] ?>"><?php echo $val['user_name']?></option>
                        <?php }} ?>
                            
                            
                        </select>
                        <!-- <input type="text" name="keyword" value="" class="form-control"> -->
                        <label class="inline">&nbsp;&nbsp;排序：</label>
                        <select name="order" class="form-control">
                            <option  value="asc">时间升序</option>
                            <option  value="desc">时间降序</option>
                        </select>
                        <button type="submit" class="btn btn-purple btn-sm" id="submit">
                            <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                            查询
                        </button>
                    </form>

                    <div class="col-xs-12">

                        </div>
                        <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th class="center"><input class="check-all" type="checkbox" value=""></th>
                                <th>用户名</th>
                                <th>充值金额</th>
                                <th class="center">充值单号</th>
                                <th class="center">支付类型</th>
                                <th>创建时间</th>
                                <th class="center">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if($recharge){ foreach ($recharge as $key => $val) { ?>
                                <tr>
                                    <td class="center">
                                        <input class="uids" type="checkbox" name="sids[]" value="<?php echo $val['money_id'];?>">
                                    </td>
                                    <td><?php echo $val['user_name']; ?></td>
                                    <td class="grouptd">
                                        <?php echo $val['money_num']; ?>
                                    </td>
                                    <td class="center"><?php echo $val['money_no']; ?></td>
                                    <td class="center"><?php if($val['money_type'] == 3)echo "充值"; ?></td>
                                    
                                    <td><?php echo date("Y-m-d H:i",$val['money_time']); ?></td>
                                    <td class="center">
                                        <!-- <a href="<?php echo site_url(X_URL.'finance/edit/'.$val['money_id']);?>">修改</a>&nbsp; -->
                                        <a class="red del" href="javascript:;" val="<?php echo site_url(X_URL.'finance/delrecharge/'.$val['money_id']);?>" title="删除">删除</a>
                                    </td>
                                </tr>
                            <?php } ?>
                            <?php }?>
                            </tbody>
                        </table>
                        <?php if($pagination){?><ul class="pagination"><?php echo $pagination;?></ul><?php }?>
<!--                        {$page}-->
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
    </div><!-- /.main-content -->

<?php $this->load->view('common/footer');?>
</div><!-- /.main-container -->

<?php $this->load->view('common/footerjs');?>
<!-- inline scripts related to this page -->
<script type="text/javascript">

    $(function () {
        $("#officialnews ul").html('<div class="ace-icon fa fa-spinner fa-spin orange"></div>');
    })
    $("#addshop").click(function () {
        window.location.href="add";
    });
    $("#submit").click(function () {
        var user_id = $("#user_id").val();
        if (user_id == 0) {
                bootbox.dialog({
                    title: "系统提示",
                    message: "用户必须选择！",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return false;
            }
        $("#form2").submit();
    });
    $(".del").click(function () {
            var url = $(this).attr('val');
            bootbox.confirm({
                title: "系统提示",
                message: "确定要删除?",
                callback: function (result) {
                    if (result) {
                        window.location.href = url;
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });

</script>
</body>
</html>
